<!DOCTYPE html>
<html>

<head>
    <meta charset="UTF-8">
    <title>战队详情</title>
    <meta content="width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=0" name="viewport" />
    <meta content="yes" name="apple-mobile-web-app-capable" />
    <meta content="black" name="apple-mobile-web-app-status-bar-style" />
    <meta content="telephone=no" name="format-detection" />
    <link rel="stylesheet" href="css/ydui.css?rev=@@hash" />
    <link rel="stylesheet" href="css/demo.css" />
    <script src="js/ydui.flexible.js"></script>
    <style>
        .cell-left {
            width: 20%
        }
    </style>
</head>

<body>
    <section class="g-flexview">
        <header class="m-navbar">
            <a href="javascript:history.back();" class="navbar-item">
                <i class="back-ico"></i>
            </a>
            <div class="navbar-center">
                <span class="navbar-title">战队详情</span>
            </div>
        </header>

        <section class="g-scrollview">
            <div class="m-cell demo-small-pitch text_team_details">
                <div class="cell-item team_details_name">
                    <div class="cell-left" style="width:40%"><img src="https://ss0.bdstatic.com/-0U0bnSm1A5BphGlnYG/tam-ogel/e21bddabb306666e860c6f4e6e5f5821_259_194.jpg" /></div>
                    <div class="cell-right" style="text-align:left; align-items:flex-start">
                        <div class="text_team">
                            <h3>大吉大利，平分鸡蛋</h3>
                            <p class="Id">ID：345435</p>
                        </div>
                    </div>
                </div>
                <div class="cell-item">
                    <div class="cell-left">战队地址</div>
                    <div class="cell-right text_l" id="teamAdress">
                        战队简介战队简介战队简介战队简介
                    </div>
                </div>
                <div class="cell-item">
                    <div class="cell-left">战队简介</div>
                    <div class="cell-right text_l teamReferral" id="teaminfo">
                        战队简介战队简介战队简介战队简介
                    </div>
                </div>
                <div class="cell-item team_details_name">
                    <div class="cell-left">战队队长</div>
                    <div class="cell-right text_l teamReferral">
                        <div class="team_user" id="team_pic"><img src="images/Userpic.png">
                            <p class="name_t">黑眼豆豆</p>
                        </div>
                    </div>
                </div>
                <div class="cell-item">
                    <div class="cell-left">战队队员</div>
                    <div class="cell-right text_l">
                        (12)
                    </div>
                </div>
                <div class="cell-item">
                    <div class="cell-left">创建时间</div>
                    <div class="cell-right text_l" id="creatTime">
                        2018.02.02 12:20:03
                    </div>
                </div>

            </div>
            <div class="m-button">
                <button type="button" id="saveBtn" class="btn-block btn-primary">申请加入</button>
            </div>

        </section>

    </section>
    <script src="http://apps.bdimg.com/libs/jquery/2.1.4/jquery.min.js"></script>
    <script src="js/ydui.js"></script>
    <script src="js/layer/layer.js"></script>

</body>
<script>
    /* 获取头部信息 */
    function GetQueryString(name) {
        var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
        var r = window.location.search.substr(1).match(reg);
        if (r != null) {
            return r[2];
        }
    };
    var token = GetQueryString('token');
    var rowId = GetQueryString('rowId');
    var userRole = GetQueryString('userRole');
    $.ajax({
        url: "http://192.168.2.201:8080/appTeam/pubgTeamDetail",
        type: "post",
        data: {
            "token": token,
            "rowId": rowId,
            "userRole": userRole
        },
        dataType: "json",
        success: function(data) {
            if (data.code == 0) {
                console.log(data.data);
                var detailsdata = data.data;
                $(".text_team h3").text(detailsdata.teamName);
                $(".text_team .Id").text('ID:' + detailsdata.teamNo);
                $("#teamAdress").text(detailsdata.placeProvince + detailsdata.placeCity + detailsdata.placeDistrict);
                $("#teaminfo").text(detailsdata.teamIntro);
                $("#team_pic img").attr('src', detailsdata.teamPhoto);
                $("#creatTime").text(detailsdata.createTime)
            } else {
                layer.msg('返回失败');
            }
        },
        error: function(data) {
            layer.msg('失败');
        }
    });

    $("#saveBtn").click(function() {
        layer.msg('加入成功');
    })
</script>

</html>